<?php

if(!defined("DB_NAME")) 
		define('DB_NAME', 'shapka'); // database name
		//define('DB_NAME', 'u2302686_default'); // database name  u2302686_default
if(!defined("DB_USER"))
		define('DB_USER', 'shapka'); // MySQL user
		//define('DB_USER', 'u2302686_default'); // database name  u2302686_default
if(!defined("DB_PASSWORD")) 
		define('DB_PASSWORD', '0000'); // MySQL password
if(!defined("DB_HOST")) {
		define('DB_HOST', 'localhost'); // MySQL password
		//define('DB_HOST', '127.0.0.1'); // MySQL password
}
		
    function getDbConnection() {
        $conn = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) or die ("Error of connecting to MySQL!". mysql_error());
		//$dblink = mysql_connect("localhost", "shapka", "0000");
        if (!$conn) {
            die('Could not connect: ' . mysql_error());
        }
        mysql_select_db(DB_NAME, $conn);
		mysql_query("SET NAMES utf8");
		mysql_query("SET character_set_client utf8");
        return $conn;
    }
?>
